home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3c / mlockall.z / mlockall
Encoding:
Text File  |  2001-04-17  |  6.9 KB  |  132 lines

  1.  
  2.  
  3.  
  4. mmmmlllloooocccckkkkaaaallllllll((((3333CCCC))))                                                      mmmmlllloooocccckkkkaaaallllllll((((3333CCCC))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _mmmm_llll_oooo_cccc_kkkk_aaaa_llll_llll, _mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk_aaaa_llll_llll - lock or unlock address space
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_mmmm_mmmm_aaaa_nnnn_...._hhhh_>>>>
  13.      _iiii_nnnn_tttt _mmmm_llll_oooo_cccc_kkkk_aaaa_llll_llll_((((_iiii_nnnn_tttt _f_l_a_g_s_))))_;;;;
  14.      _iiii_nnnn_tttt _mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk_aaaa_llll_llll_((((_vvvv_oooo_iiii_dddd_))))_;;;;
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      _mmmm_llll_oooo_cccc_kkkk_aaaa_llll_llll locks all pages mapped in the address space of the calling
  18.      process into memory, including: text, data, stack and mmaped regions.
  19.      Locked pages are immune to all routine swapping.
  20.  
  21.      The value of _f_l_a_g_s determines whether the pages to be locked are those
  22.      currently mapped by the address space, those that will be mapped in the
  23.      future, or both:
  24.  
  25.                _MMMM_CCCC_LLLL______CCCC_UUUU_RRRR_RRRR_EEEE_NNNN_TTTT    Lock current mappings
  26.  
  27.                _MMMM_CCCC_LLLL______FFFF_UUUU_TTTT_UUUU_RRRR_EEEE     Lock future mappings
  28.  
  29.      _mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk_aaaa_llll_llll unlocks all memory mapped pages in the address space of the
  30.      calling process, regardless of the number of times the pages were locked.
  31.      Automatic memory locking of future memory mappings is disabled for the
  32.      process.
  33.  
  34.      Locks established with _mmmm_llll_oooo_cccc_kkkk_aaaa_llll_llll are not inherited by a child process
  35.      after a _ffff_oooo_rrrr_kkkk.
  36.  
  37.      If the address space contains autogrow regions [see _mmmm_mmmm_aaaa_pppp(2)], _mmmm_llll_oooo_cccc_kkkk_aaaa_llll_llll
  38.      will only cause the pages through the current end of file to be locked
  39.      down.
  40.  
  41.      In the event automatic memory locking of future mappings is enabled for a
  42.      process (_MMMM_CCCC_LLLL______FFFF_UUUU_TTTT_UUUU_RRRR_EEEE), and the locked memory of that process stack space
  43.      exceeds either the system's physical memory or the maximum amount of
  44.      lockable pages per process as determined by the system variable _mmmm_aaaa_xxxx_llll_kkkk_mmmm_eeee_mmmm,
  45.      the process will receive a _SSSS_IIII_GGGG_SSSS_EEEE_GGGG_VVVV with a signal code of _EEEE_NNNN_OOOO_MMMM_EEEE_MMMM [see
  46.      _ssss_iiii_gggg_aaaa_cccc_tttt_iiii_oooo_nnnn(2) and _ssss_iiii_gggg_nnnn_aaaa_llll(5)]. If the locked memory of the process heap
  47.      space exceeds either the system's physical memory or the maximum amount
  48.      of lockable pages per process _mmmm_aaaa_xxxx_llll_kkkk_mmmm_eeee_mmmm, the system call which attempts
  49.      the expansion will fail without making a change to the amount of
  50.      allocated space, and _eeee_rrrr_rrrr_nnnn_oooo is set to _EEEE_NNNN_OOOO_MMMM_EEEE_MMMM.
  51.  
  52.      _mmmm_llll_oooo_cccc_kkkk_aaaa_llll_llll or _mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk_aaaa_llll_llll will fail if one or more of the following are
  53.      true:
  54.  
  55.      [EAGAIN]    There was insufficient lockable memory to lock the entire
  56.                  address space.  This may occur even though the amount
  57.                  requested was less than the system-imposed maximum number of
  58.                  locked pages.
  59.  
  60.  
  61.  
  62.                                                                         PPPPaaaaggggeeee 1111
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. mmmmlllloooocccckkkkaaaallllllll((((3333CCCC))))                                                      mmmmlllloooocccckkkkaaaallllllll((((3333CCCC))))
  70.  
  71.  
  72.  
  73.      [EBUSY]     _mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk_aaaa_llll_llll will fail with this error if a region of the
  74.                  address space has some active I/O initiated by some other
  75.                  process belonging to same share group.
  76.  
  77.      [EINVAL]    The _f_l_a_g_s argument is zero or contains invalid flags.
  78.  
  79.      [ENOMEM]    The caller was not super-user and the number of pages to be
  80.                  locked exceeded the maximum number of lockable pages per
  81.                  process as defined by the system variable _m_a_x_l_k_m_e_m [see
  82.                  _ssss_yyyy_ssss_tttt_uuuu_nnnn_eeee(1M)].
  83.  
  84.      [ENOMEM]    The total number of pages locked by the caller would exceed
  85.                  the maximum resident size for the process [see _ssss_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2)].
  86.  
  87.      [ENOSPC]    The address space of the calling process contains a memory-
  88.                  mapped file, and there is insufficient space on the device to
  89.                  allocate the entire file.
  90.  
  91. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  92.      exec(2), exit(2), fork(2), mmap(2), mlock(3C), munlock(3C), mpin(2),
  93.      munpin(2), plock(2), sigaction(2), sysconf(3C)
  94.  
  95. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  96.      Upon successful completion, the functions _mmmm_llll_oooo_cccc_kkkk_aaaa_llll_llll and _mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk_aaaa_llll_llll return
  97.      0, otherwise, they return -1 and set _eeee_rrrr_rrrr_nnnn_oooo to indicate the error.
  98.  
  99. WWWWAAAARRRRNNNNIIIINNNNGGGG
  100.      The _mmmm_llll_oooo_cccc_kkkk_aaaa_llll_llll_////_mmmm_uuuu_nnnn_llll_oooo_cccc_kkkk_aaaa_llll_llll pair and the _pppp_llll_oooo_cccc_kkkk function provide similar
  101.      functionality. Developers should choose the set that best suites their
  102.      application and stick with it, as mixing the interfaces may result in
  103.      unexpected behavior.
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.                                                                         PPPPaaaaggggeeee 2222
  129.  
  130.  
  131.  
  132.